package utils;
/*ObjectWriter.java
 *CS193J
 *Summer 2001
 */

import java.io.*;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public class StringWriter {

    public static  void write (String filename, List<String> lines) {
	try {
	    FileWriter fr = new FileWriter(filename);
	    BufferedWriter br = new BufferedWriter(fr);
	    for (Iterator<String> i = lines.iterator(); i.hasNext();) {
		br.write(i.next()+"\r\n");
	    }
	    br.flush();
	    br.close();
	} catch (Exception e) {
	    e.printStackTrace();
	}
	
    }


}
